using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class pages_Contact : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }
    protected void lnkSend_Click(object sender, EventArgs e)
    {
        FeedbackDAO daoFeedback = new FeedbackDAO();
        Feedback fb = new Feedback();
        fb.Subject = txtSubject.Text;
        fb.Content = txtContent.Text;
        fb.WriterEmail = txtEmail.Text;
        fb.WriterName = txtName.Text;
        fb.Date = DateTime.Now;
        fb.IsReplied = false;
        if (daoFeedback.Insert(fb) > 0)
        {
            Response.Write("<script language='javascript'>alert ('Thank you for your feedback.')</script>");
            txtName.Text = "";
            txtSubject.Text = "";
            txtContent.Text = "";
            txtEmail.Text = "";            
        }
        else
        {
            Response.Write("<script  language='javascript'>alert ('Sorry! Some error has occured, and system cannot receive feedback now. Please try it late.\nThank you!')</script>");
        }
    }
}
